//用嵌套风格定义包
package com {

  import com.atguigu.scala.Inner

  //在外层包定义单例对象
  object Outer {
    var out: String = "out"

    def main(args: Array[String]): Unit = {
      println(Inner.in)
    }
  }

  package atguigu {
    package scala {

      //在内层包中定义单例对象
      object Inner {
        var in: String = "In"

        def main(args: Array[String]): Unit = {
          println(Outer.out)
          Outer.out = "outer"
          println(Outer.out)
        }
      }

    }

  }

}


package aa {
  package bb {
    import com.atguigu.scala.Inner

    object hello {
      def main(args: Array[String]): Unit = {
        println(Inner.in)
      }
    }

  }

}